﻿@model IEnumerable<PhotoGallery.Models.VideoAttacumentsInfo>

    <div>
        @using (Html.BeginForm("Associate", "Video", new { id = 0, videoID = ViewBag.VideoID }, FormMethod.Post, new { id = "formAssociate", enctype = "multipart/form-data" }))
        {
        <div class="styleFileInput"  style="float:left;padding-right:10px;">  
            <input type="hidden" value="@ViewBag.VideoID" />     
            <input type="text" class="browseText" /> 
            <input type="button" value="Browse" class="browseButton" /> 
            <input type="file" name="file1"  accept="video/*" class="theFileInput validate[required,custom['File is required']"  />
        </div>
        <input type="submit" value="Add" title="Add file" />
        }
    </div>
    <div>
    @if (Model.Count() > 0)
    {
        <table border="1">
        @foreach (var item in Model)
        {
            @Html.HiddenFor(model => item.ID)
            @Html.HiddenFor(model => item.FileName)

            <tr>
                <td>@item.FileName</td>
                <td>@item.MimeType</td>
                <td>
                    <form action="@Url.Action("Disassociate", "Video", new { id = item.ID, videoID = item.VideoID})" method="post">
                    <input type="submit" value="Remove" title="Remove this file" />
                    </form>
                </td>                               
            </tr>

        }
        </table>
    }
    </div>
